package com.hk.jmm.upload;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class UploadsResult {


    /**
     * urls : https://xiangsoft.oss-cn-beijing.aliyuncs.com/img/2023/08/14/card_hint2.png_20230814100508A011.png,https://xiangsoft.oss-cn-beijing.aliyuncs.com/img/2023/08/14/card_hint3_20230814100508A012.png
     * newFileNames : card_hint2.png_20230814100508A011.png,card_hint3_20230814100508A012.png
     * fileNames : https://xiangsoft.oss-cn-beijing.aliyuncs.com/img/2023/08/14/card_hint2.png_20230814100508A011.png,https://xiangsoft.oss-cn-beijing.aliyuncs.com/img/2023/08/14/card_hint3_20230814100508A012.png
     * originalFilenames : card_hint2.png.png,card_hint3.png
     */

    private String urls;
    private String newFileNames;
    private String fileNames;
    private String originalFilenames;

    public String getUrls() {
        return urls;
    }

    public void setUrls(String urls) {
        this.urls = urls;
    }

    public String getNewFileNames() {
        return newFileNames;
    }

    public void setNewFileNames(String newFileNames) {
        this.newFileNames = newFileNames;
    }

    public String getFileNames() {
        return fileNames;
    }

    public void setFileNames(String fileNames) {
        this.fileNames = fileNames;
    }

    public String getOriginalFilenames() {
        return originalFilenames;
    }

    public void setOriginalFilenames(String originalFilenames) {
        this.originalFilenames = originalFilenames;
    }

    public List<String> getListUrls(){
        List<String> result = new ArrayList<>();
        if (urls!=null){
            if (urls.contains(",")){
                String[] arr=  urls.split(",");
                result = Arrays.asList(arr);
            }else {
                result.add(urls);
            }
        }
        return  result==null?new ArrayList<String>():result;
    }
}
